package rkdwogus7.basic;

public class J10_OOP {

	public static void main(String[] args) {
		// OOP 기본 - 클래스 작성
		// 클래스를 이용하여 객체를 생성하려면 new 연산자와 생성자를 사용
		// 또한, 생성된 객체를 변수화하려면 객체와 동일한 자료형으로 선언
		// 개체화
		// stud, depart, subj, prof는
		// 각각 인스턴스 변수임
		J10Student stud = new J10Student();
		J10Department deprt = new J10Department();
		J10Subject subj = new J10Subject();
		J10Professor prof = new J10Professor();
		
		stud.hakbun = "201350050";
		stud.name = "김태희";
		stud.addr = "경기도 고양시";
		stud.birth = "1985.3.22";
		stud.depart = "컴퓨터";
		stud.prof = "504";
		
		System.out.println( stud.hakbun );
		System.out.println( stud.name );
		System.out.println( stud.addr );
		System.out.println( stud.birth );
		System.out.println( stud.depart );
		System.out.println( stud.prof );
		System.out.println();
		
		deprt.departName = "컴퓨터공학";
		deprt.telNo = "123-4567-8910";
		deprt.office = "E동 2층";
		deprt.chief = "504";
		
		System.out.println( deprt.departName );
		System.out.println( deprt.telNo );
		System.out.println( deprt.office );
		System.out.println( deprt.chief );
		System.out.println();
		
		subj.subNo = "0205";
		subj.subName = "프로그래밍";
		subj.summary = "자바 프로그래밍";
		subj.prof = "301";
		
		System.out.println( subj.subNo );
		System.out.println( subj.subName );
		System.out.println( subj.summary );
		System.out.println( subj.prof );
		System.out.println();
		
		prof.profNo = "301";
		prof.profName = "이순신";
		prof.profMajor = "프로그래밍";
		
		System.out.println( prof.profNo );
		System.out.println( prof.profName );
		System.out.println( prof.profMajor );
		System.out.println();
		
		
		
	} // main

	
} // class

class J10Student {
	// 필드, 멤버변수
	String hakbun;
	String name;
	String addr;
	String birth;
	String depart;
	String prof;
	// 생성자
	public J10Student() {
		
	}
	
	
} // J10Student

class J10Department {
	String departName;
	String telNo;
	String office;
	String chief;
	public J10Department() {
		
	}
} // J10Department

class J10Subject {
	String subNo;
	String subName;
	String summary;
	String prof;
	public J10Subject() {
		
	}
} // J10Subject

class J10Professor {
	String profNo;
	String profName;
	String profMajor;
	public J10Professor() { }
} // J10Professor

















